/*
Date:20210417 11:00pm
key:就按题目打就好，没什么特别的
*/
class Solution {
public:
    int minOperations(vector<int>& nums) 
    {
    if(nums.size()<=1){return 0;}
    int count=0;
    for(int i=0;i<nums.size();i++)
    {
        if(i!=0)
        {
            if(nums[i-1]>=nums[i])
            {
                count+=nums[i-1]+1-nums[i];
                nums[i]=nums[i-1]+1;
                
            }
        }
    }
        return count;
    }
};